package com.tsunade.spring6.resource.controller;

import com.tsunade.spring6.resource.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * @Project ：learn_spring
 * @File ：UserController.java
 * @IDE ：IntelliJ IDEA
 * @Author ：自由如风间
 * @Date ：2025/3/30 19:10
 * @Description ：For study.
 */

@Controller
public class UserController {

    // 根据名称进行注入
    @Resource(name = "myUserService")
    private UserService userService;

    public void add() {
        System.out.println("controller方法正在执行...");
        userService.add();
    }
}
